package com.refusea.train.controller

import com.refusea.train.domain.helper.UploadHelper
import org.springframework.web.bind.annotation.PutMapping
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RequestParam
import org.springframework.web.bind.annotation.RestController
import org.springframework.web.multipart.MultipartFile

@RestController
@RequestMapping("/api/private")
class FileUploadController(private val uploadHelper: UploadHelper) {

    @PutMapping("/upload")
    fun uploadFile(@RequestParam("file") file: MultipartFile): String {
        return uploadHelper.upload(file)
    }
}
